<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>设置滚动条的样式</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    html,
    body {
        width: 100%;
        height: 100%;
    }

    .box {
        height: 30%;
        margin-bottom: 50px;
        background-color: wheat;
        text-align: center;
        overflow: scroll;
    }

    .box>div {
        width: 90%;
        height: 110%;
        margin: 10px auto;
        border: 1px solid gray;
    }

    /* 整个滚动条的设置 */
    .box2::-webkit-scrollbar {
        width: 6px;
        /* background-color: transparent; */
        background-color: #fff;
    }

    /* 滚动条滑块的设置 */
    .box2::-webkit-scrollbar-thumb {
        background-color: #bbb;
        border-radius: 10px;
        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
    }

    .box2::-webkit-scrollbar-thumb:hover {
        background: #000;
    }

    /* 滚动条轨道的设置 */
    .box2::-webkit-scrollbar-track {
        display: none;
    }

    /* 滚动条轨道内侧的设置 */
    .box2::-webkit-scrollbar-track-piece {
        background: orange;
    }

    /* xy滚动条相交拐角的设置 */
    .box2::-webkit-scrollbar-corner {
        background: #179a16;
    }

    /* 滚动上下按钮的设置 */
    .box2::-webkit-scrollbar-button {
        background-color: palegoldenrod;
    }

    /* 滚动水平下按钮的设置 */
    .box2::-webkit-scrollbar-button:horizontal:increment {
    }
    /* 滚动垂直下按钮的设置 */
    .box2::-webkit-scrollbar-button:vertical:increment {
        background: url(./img/down.png) no-repeat center;
        background-size: contain;
        background-color: palegoldenrod;
    }
    /* 滚动垂直上按钮的设置 */
    .box2::-webkit-scrollbar-button:vertical:decrement {
        background: url(./img/up.png) no-repeat center;
        background-size: contain;
        background-color: palegoldenrod;
    }

    /* 整个滚动条的设置 */
    .box2 textarea::-webkit-scrollbar {
        width: 6px;
        /* background-color: transparent; */
        background-color: #fff;
    }

    /* 滚动条滑块的设置 */
    .box2 textarea::-webkit-scrollbar-thumb {
        background-color: #bbb;
        border-radius: 10px;
        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
    }

    .box2 textarea::-webkit-scrollbar-thumb:hover {
        background: #000;
    }

    /* 滚动条轨道的设置 */
    .box2 textarea::-webkit-scrollbar-track {
        display: none;
    }

    /* 右小角拖动块的设置 */
    .box2 textarea::-webkit-resizer {
        background: blue;
    }
</style>

<body>
    <!-- 修改前 -->
    <div class="box">
        <div></div>
        <textarea name="" id="" cols="30" rows="3"></textarea>
    </div>
    <!-- 修改后 -->
    <div class="box box2">
        <div></div>
        <textarea name="" id="" cols="30" rows="3"></textarea>
    </div>
</body>

</html>